<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="theme-color" content="#0078E7"><meta name="author" content="Kken"><meta name="copyright" content="Kken"><meta name="generator" content="Hexo 5.4.0"><meta name="theme" content="hexo-theme-yun"><title>博客搭建过程与心得 | Kkenの牢骚小站</title><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@900&amp;display=swap" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/star-markdown-css@0.1.25/dist/yun/yun-markdown.min.css"><script src="//at.alicdn.com/t/font_1140697_dxory92pb0h.js" async></script><script src="https://cdn.jsdelivr.net/npm/scrollreveal/dist/scrollreveal.min.js" defer></script><script>document.addEventListener("DOMContentLoaded", () => {
  [".post-card",".post-content img"].forEach((target)=> {
    ScrollReveal().reveal(target);
  })
});
</script><link id="light-prism-css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@latest/themes/prism.css" media="(prefers-color-scheme: light)"><link id="dark-prism-css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@latest/themes/prism-tomorrow.css" media="(prefers-color-scheme: dark)"><link rel="icon" href="/yun.svg"><link rel="mask-icon" href="/yun.svg" color="#0078E7"><link rel="alternate icon" href="/yun.ico"><link rel="preload" href="/css/hexo-theme-yun.css" as="style"><link rel="preload" href="/js/utils.js" as="script"><link rel="preload" href="/js/hexo-theme-yun.js" as="script"><link rel="prefetch" href="/js/sidebar.js" as="script"><link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin><script id="yun-config">
    const Yun = window.Yun || {};
    window.CONFIG = {"hostname":"kenguo05.github.io","root":"/","title":["Kken","の","牢","骚","小","站"],"version":"1.6.1","mode":"auto","copycode":true,"page":{"isPost":true},"i18n":{"placeholder":"搜索...","empty":"找不到您查询的内容: ${query}","hits":"找到 ${hits} 条结果","hits_time":"找到 ${hits} 条结果（用时 ${time} 毫秒）"},"anonymous_image":"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/avatar/none.jpg","say":{"api":"https://v1.hitokoto.cn","hitokoto":true},"local_search":{"path":"/search.json"},"fireworks":{"colors":["102, 167, 221","62, 131, 225","33, 78, 194"]}};
  </script><link rel="stylesheet" href="/css/hexo-theme-yun.css"><script src="/js/utils.js"></script><script src="/js/hexo-theme-yun.js"></script><link rel="alternate" href="/atom.xml" title="Kkenの牢骚小站" type="application/atom+xml"><meta name="description" content="第一次自己搭建博客现在是暑假嘛，反正没啥事干，正好在网上看见不少个人博客搭建教程，就想着自己搭着玩玩，于是便选择了Hexo框架，看着教程和文档一步一步搭，不过居然比我想象中简单，有手就行，这里就大概讲一讲本人搭建该博客的过程和体会吧。（注意：这不是教程，只是把本人搭建过程记录一下而已，怕我忘掉，具体过程建议百度） 本地环境搭建 这个不多说，先把Node.js 下好安装，在终端里输入node --v">
<meta property="og:type" content="article">
<meta property="og:title" content="博客搭建过程与心得">
<meta property="og:url" content="https://kenguo05.github.io/2021/08/05/blog-generating-sharing/index.html">
<meta property="og:site_name" content="Kkenの牢骚小站">
<meta property="og:description" content="第一次自己搭建博客现在是暑假嘛，反正没啥事干，正好在网上看见不少个人博客搭建教程，就想着自己搭着玩玩，于是便选择了Hexo框架，看着教程和文档一步一步搭，不过居然比我想象中简单，有手就行，这里就大概讲一讲本人搭建该博客的过程和体会吧。（注意：这不是教程，只是把本人搭建过程记录一下而已，怕我忘掉，具体过程建议百度） 本地环境搭建 这个不多说，先把Node.js 下好安装，在终端里输入node --v">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-08-05T12:23:48.000Z">
<meta property="article:modified_time" content="2021-08-18T03:56:32.274Z">
<meta property="article:author" content="Kken">
<meta property="article:tag" content="Hexo">
<meta property="article:tag" content="博客搭建">
<meta property="article:tag" content="分享">
<meta name="twitter:card" content="summary"><script src="/js/ui/mode.js"></script></head><body><script defer src="https://cdn.jsdelivr.net/npm/animejs@latest"></script><script defer src="/js/ui/fireworks.js"></script><canvas class="fireworks"></canvas><div class="container"><a class="sidebar-toggle hty-icon-button" id="menu-btn"><div class="hamburger hamburger--spin" type="button"><span class="hamburger-box"><span class="hamburger-inner"></span></span></div></a><div class="sidebar-toggle sidebar-overlay"></div><aside class="sidebar"><script src="/js/sidebar.js"></script><ul class="sidebar-nav"><li class="sidebar-nav-item sidebar-nav-toc hty-icon-button sidebar-nav-active" data-target="post-toc-wrap" title="文章目录"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-list-ordered"></use></svg></li><li class="sidebar-nav-item sidebar-nav-overview hty-icon-button" data-target="site-overview-wrap" title="站点概览"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-passport-line"></use></svg></li></ul><div class="sidebar-panel" id="site-overview-wrap"><div class="site-info fix-top"><a class="site-author-avatar" href="/about/" title="Kken"><img width="96" loading="lazy" src="/images/avatar.png" alt="Kken"></a><div class="site-author-name"><a href="/about/">Kken</a></div><a class="site-name" href="/about/site.html">Kkenの牢骚小站</a><sub class="site-subtitle">一般屑学生的辣鸡博客</sub><div class="site-desciption"></div></div><nav class="site-state"><a class="site-state-item hty-icon-button icon-home" href="/" title="首页"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-home-4-line"></use></svg></span></a><div class="site-state-item"><a href="/archives/" title="归档"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-book-2-line"></use></svg></span><span class="site-state-item-count">4</span></a></div><div class="site-state-item"><a href="/categories/" title="分类"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-2-line"></use></svg></span><span class="site-state-item-count">5</span></a></div><div class="site-state-item"><a href="/tags/" title="标签"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="site-state-item-count">5</span></a></div><a class="site-state-item hty-icon-button" target="_blank" rel="noopener" href="https://github.com/Kenguo05/Kenguo05.github.io/tree/hexo" title="源文件"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-archive-line"></use></svg></span></a></nav><hr style="margin-bottom:0.5rem"><div class="links-of-author"><a class="links-of-author-item hty-icon-button" rel="noopener" href="/atom.xml" title="RSS" target="_blank" style="color:orange"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-rss-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://github.com/Kenguo05" title="GitHub" target="_blank" style="color:#6e5494"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-github-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://www.zhihu.com/people/chu-jian-72-81-2" title="知乎" target="_blank" style="color:#0084FF"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-zhihu-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://space.bilibili.com/141573043" title="哔哩哔哩" target="_blank" style="color:#FF8EB3"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-bilibili-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="mailto:2330281803@qq.com" title="E-Mail" target="_blank" style="color:#8E71C1"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-mail-line"></use></svg></a></div><br><a class="links-item hty-icon-button" id="toggle-mode-btn" href="javascript:;" title="Mode" style="color: #f1cb64"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-contrast-2-line"></use></svg></a></div><div class="sidebar-panel sidebar-panel-active" id="post-toc-wrap"><div class="post-toc"><div class="post-toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC%E4%B8%80%E6%AC%A1%E8%87%AA%E5%B7%B1%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2"><span class="toc-number">1.</span> <span class="toc-text">第一次自己搭建博客</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA"><span class="toc-number">1.1.</span> <span class="toc-text">本地环境搭建</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E6%90%AD%E5%BB%BA"><span class="toc-number">1.2.</span> <span class="toc-text">远程仓库搭建</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA"><span class="toc-number">1.3.</span> <span class="toc-text">本地博客搭建</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%86%E6%9C%AC%E5%9C%B0%E6%96%87%E4%BB%B6%E4%B8%8E%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E5%BB%BA%E7%AB%8B%E5%85%B3%E8%81%94"><span class="toc-number">1.4.</span> <span class="toc-text">将本地文件与远程仓库建立关联</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2%E4%B8%8E%E5%A4%87%E4%BB%BD"><span class="toc-number">1.5.</span> <span class="toc-text">部署与备份</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%AA%E4%BA%BA%E6%84%9F%E5%8F%97"><span class="toc-number">1.6.</span> <span class="toc-text">个人感受</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%A5%E4%B8%8A%EF%BC%8C%E7%AC%AC%E4%B8%80%E7%AF%87%E6%AD%A3%E7%BB%8F%E5%8D%9A%E5%AE%A2"><span class="toc-number">1.7.</span> <span class="toc-text">以上，第一篇正经博客</span></a></li></ol></li></ol></div></div></div></aside><main class="sidebar-translate" id="content"><div id="post"><article class="hty-card post-block" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://Kenguo05.github.io/2021/08/05/blog-generating-sharing/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="Kken"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="Kkenの牢骚小站"></span><header class="post-header"><h1 class="post-title" itemprop="name headline">博客搭建过程与心得</h1><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间：2021-08-05 20:23:48" itemprop="dateCreated datePublished" datetime="2021-08-05T20:23:48+08:00">2021-08-05</time><span class="post-meta-divider">-</span><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-2-line"></use></svg></span> <time title="修改时间：2021-08-18 11:56:32" itemprop="dateModified" datetime="2021-08-18T11:56:32+08:00">2021-08-18</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">1.8k</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">6m</span></span></span><div class="post-classify"><span class="post-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/Kken%E7%9A%84%E5%BF%83%E5%BE%97%E5%88%86%E4%BA%AB/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">Kken的心得分享</span></a></span> > <span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/Kken%E7%9A%84%E5%BF%83%E5%BE%97%E5%88%86%E4%BA%AB/%E6%8A%80%E6%9C%AF%E5%BF%83%E5%BE%97/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">技术心得</span></a></span></span><span class="post-tag"><span class="post-meta-divider">-</span><a class="tag-item" href="/tags/Hexo/" style="--text-color:#0E83CD"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">Hexo</span></a><a class="tag-item" href="/tags/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">博客搭建</span></a><a class="tag-item" href="/tags/%E5%88%86%E4%BA%AB/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">分享</span></a></span></div></div></header><section class="post-body" itemprop="articleBody"><div class="post-content markdown-body" style="--smc-primary:#0078E7;"><h2 id="第一次自己搭建博客"><a href="#第一次自己搭建博客" class="headerlink" title="第一次自己搭建博客"></a>第一次自己搭建博客</h2><p>现在是暑假嘛，反正没啥事干，正好在网上看见不少个人博客搭建教程，就想着自己搭着玩玩，于是便选择了<a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/">Hexo</a>框架，看着教程和文档一步一步搭，不过居然比我想象中简单，<del>有手就行</del>，这里就大概讲一讲本人搭建该博客的过程和体会吧。（注意：这不是教程，只是把本人搭建过程记录一下而已，<del>怕我忘掉</del>，具体过程建议百度）</p>
<h3 id="本地环境搭建"><a href="#本地环境搭建" class="headerlink" title="本地环境搭建"></a>本地环境搭建</h3><hr>
<p>这个不多说，先把<a target="_blank" rel="noopener" href="https://nodejs.org/en/">Node.js </a>下好安装，在终端里输入<code>node --version</code>检验是否安装成功，好，搞定。这个时候可以使用Node.js带的包管理工具<code>npm</code>安装Hexo工具（国内使用<code>npm</code>速度有点慢，<strong>可以考虑换<code>taobao</code>源</strong>），很简单，一行命令足矣。=￣ω￣=</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">npm install hexo-cli -g</code></pre>

<h3 id="远程仓库搭建"><a href="#远程仓库搭建" class="headerlink" title="远程仓库搭建"></a>远程仓库搭建</h3><hr>
<p>这玩意都不用搭建，去<del>知名同性交友网站</del><a target="_blank" rel="noopener" href="https://github.com/">GitHub</a>上<code>create</code>就完事了，省时省力又省钱，仓库命名记得设为<code>用户名.github.io</code>，这个就是博客的域名了，自定义域名？懒得注册，懒得备案，先稍稍吧（国内访问GitHub速度不稳定，<strong>嫌慢可以考虑<a target="_blank" rel="noopener" href="https://gitee.com/">Gitee</a>试试</strong>）。好了远程也搞定了，现在就只要把本地和远程关联起来部署上去就好了，好耶！！！！\^o^/</p>
<blockquote>
<p>Git与GitHub的使用是基本功，而且这个网上教程一大把，搭个博客也不需要对此理解多深，会用就行(。・∀・)ノ</p>
</blockquote>
<h3 id="本地博客搭建"><a href="#本地博客搭建" class="headerlink" title="本地博客搭建"></a>本地博客搭建</h3><hr>
<p>之前不是在本地安装了Hexo吗，现在利用这个工具，选择一个合适的目录，在终端中输入命令</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">hexo init 你想为你的Hexo工作目录取的名字
cd 你想为你的Hexo工作目录取的名字
npm install
# 我一般写成hexo s比较省事
hexo server</code></pre>

<p>现在博客已经在本地跑起来了，默认通过<code>localhost:4000</code>这个端口访问，一般用于本地预览。</p>
<p>此时的博客使用的是默认的主题，叫<code>landscape</code>（好像是这个名来着），有点太普通了？直接网上搜其他更好康的主题，推荐一波我用的主题<a target="_blank" rel="noopener" href="https://github.com/YunYouJun/hexo-theme-yun">Yun</a>（没收广告费，我是真觉得不戳）。把主题安装到<code>Hexo工作目录/themes</code>下，修改<code>Hexo工作目录</code>下的<code>_config.yml</code>配置文件，找到<code>theme</code>项，更改为</p>
<pre class="language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">theme</span><span class="token punctuation">:</span> yun
<span class="token comment"># 记得写所要使用的主题的文件夹名</span></code></pre>

<blockquote>
<p>事实说明，一个好看的主题可以极大的提升博客站长完善与维护博客的心理体验</p>
</blockquote>
<p>如果想要对主题进行更多配置的话建议自行搜索方法或看主题的制作者是否提供相关文档，比如我所用的主题就有<a target="_blank" rel="noopener" href="https://yun.yunyoujun.cn/guide/">Yun主题使用指南</a>手把手教你配置。</p>
<p><code>_config.yml</code>中还可以修改许多配置，可以将自己的博客进行各种自定义，建议看<a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/">官方文档</a>好好学。</p>
<p>各项配置完成后，现在可以生成将会被展示出来的静态文件了，在终端中输入</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">hexo clean
# g 就是 generate 的缩写
hexo g</code></pre>

<blockquote>
<p>如果注意观察文件夹，会发现，当输入<code>hexo clean</code>命令后，目录下的<code>public</code>子目录会被删除，输入<code>hexo g</code>命令后，该子目录又会重新生成，这是因为该子目录下存放的就是将会在网页上被浏览的静态文件，当对博客进行修改后，先<code>clean</code>掉原本的静态文件，在<code>generate</code>新的静态文件，这样就完成了对博客的更新。</p>
</blockquote>
<p>如果还想在本地预览的话就接着输入</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">hexo s</code></pre>

<p>OK！现在本地博客已经搞定了，开始着手把它部署到远端吧！\(@^0^@)/</p>
<h3 id="将本地文件与远程仓库建立关联"><a href="#将本地文件与远程仓库建立关联" class="headerlink" title="将本地文件与远程仓库建立关联"></a>将本地文件与远程仓库建立关联</h3><hr>
<p>基本的git操作了，直接在工作目录下</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">git init # 此时这个目录就被初始化成了一个Git仓库</code></pre>

<p>然后可以建立一个分支</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">git checkout -b hexo # 表示建立了一个名叫hexo的分支</code></pre>

<p>这个分支我将用于备份博客的源代码文件。（本来没有备份的习惯，但这里参考了<a target="_blank" rel="noopener" href="https://www.yunyoujun.cn/share/how-to-build-your-site/">教你如何从零开始搭建一个属于自己的网站 </a>的教程，就也学着做了）</p>
<p>将这个本地的Git仓库与之前在GitHub上搭建的远程仓库建立关联</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">git remote add origin https:&#x2F;&#x2F;github.com&#x2F;用户名&#x2F;用户名.github.io</code></pre>

<p>安装Hexo的部署插件<code>hexo-deployer-git</code></p>
<pre class="language-sh" data-language="sh"><code class="language-sh">npm install hexo-deployer-git</code></pre>

<p>在<code>_config.yml</code>配置文件中的<code>deployer</code>项中修改</p>
<pre class="language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">deploy</span><span class="token punctuation">:</span>
  <span class="token key atrule">type</span><span class="token punctuation">:</span> git
  <span class="token key atrule">repo</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//github.com/用户名/用户名.github.io.git <span class="token comment"># 远程仓库的网址</span>
  <span class="token key atrule">branch</span><span class="token punctuation">:</span> main <span class="token comment"># 分支名，表示将要部署的分支</span>
  <span class="token key atrule">message</span><span class="token punctuation">:</span> <span class="token comment"># 可选填，对更新部署的说明</span></code></pre>

<p>至此，本地与远程关联建立完成！</p>
<h3 id="部署与备份"><a href="#部署与备份" class="headerlink" title="部署与备份"></a>部署与备份</h3><hr>
<p>部署很简单，之前部署安装了<code>hexo-deployer-git</code>这个插件吗，生成静态文件后直接输入命令</p>
<pre class="language-sh" data-language="sh"><code class="language-sh">hexo d # d 是 deploy 的缩写</code></pre>

<p>完成部署！</p>
<p>然后还可以对网站源文件上传到远端进行备份，就利用之前建立的分支，同样是基本的git命令</p>
<pre class="language-sh" data-language="sh"><code class="language-sh"># git代码提交老三样
git add -A
git commit -m &quot;xxx&quot; # 养成备注说明的好习惯
git push # 第一次推送记得指定默认分支
# git push --set-upstream origin hexo</code></pre>

<p>ohhhhhh！！！现在个人博客已经搭建完毕了！用浏览器访问看看⑧！！ヽ(✿ﾟ▽ﾟ)ノ</p>
<h3 id="个人感受"><a href="#个人感受" class="headerlink" title="个人感受"></a>个人感受</h3><hr>
<p>其实搭建个人博客是受了b站up主<a target="_blank" rel="noopener" href="https://space.bilibili.com/384068749/">CodeSheep</a>的某期视频<a target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1Yb411a7ty">手把手教你从0开始搭建自己的个人博客 </a>的影响，就自己搭着看看，一路做下来，只能说很多事情唯一的难点就是 <em>Just do it</em> 了，自己搭建博客之前总觉得这玩意涉及了一堆看不懂的技术栈，我这种又菜又懒的辣鸡肯定搭不出来，结果当自己真正上手做了才发现并没有想象的那么夸张，许多东西都是很基础的命令，比如简单的git命令。真正遇到问题了也大多可以通过自己搜索解决，Hexo官方与我所使用的主题也提供了详细的配置文档供我参考，实际过程中并没有遇到什么无法解决的问题，还学到了不少前端知识，<del>爷真nb</del>。希望以后遇到新事物新技术是也能冷静下来好好研究吧，这里总结一下搭建时的心得经验吧：</p>
<ul>
<li><strong>不要怕，Just do it! 迈出第一步就成功了一半</strong></li>
<li>记得提前搭建好本地环境，比如Node.js，git等工具</li>
<li>搞清楚每一步要在哪一个目录下进行，各种链接与路径要弄清楚</li>
<li>出问题了别紧张，看清楚报错信息，网上搜一般都可以搜到解决办法</li>
<li>搜到解决办法不要看见什么就用什么，多看几个人的回答，找大家都提到的方法成功率更高</li>
<li>不知道下一步怎么做了就看相关文档，文档讲的很详细</li>
</ul>
<hr>
<h3 id="以上，第一篇正经博客"><a href="#以上，第一篇正经博客" class="headerlink" title="以上，第一篇正经博客"></a>以上，第一篇正经博客</h3><p>感谢支持o(*￣▽￣*)o</p>
</div><div id="reward-container"><span class="hty-icon-button button-glow" id="reward-button" title="打赏" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === &quot;none&quot;) ? &quot;block&quot; : &quot;none&quot;;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-hand-coin-line"></use></svg></span><div id="reward-comment">孩子没吃的了TAT</div><div id="qr" style="display:none;"><div style="display:inline-block"><a target="_blank" rel="noopener" href="https://cdn.jsdelivr.net/gh/Kenguo05/blog-img/img/pay-qrcode/IMG_20210804_163731.jpg"><img loading="lazy" src="https://cdn.jsdelivr.net/gh/Kenguo05/blog-img/img/pay-qrcode/IMG_20210804_163731.jpg" alt="支付宝" title="支付宝"></a><div><span style="color:#00A3EE"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-alipay-line"></use></svg></span></div></div><div style="display:inline-block"><a target="_blank" rel="noopener" href="https://cdn.jsdelivr.net/gh/Kenguo05/blog-img/img/pay-qrcode/IMG_20210804_163811.png"><img loading="lazy" src="https://cdn.jsdelivr.net/gh/Kenguo05/blog-img/img/pay-qrcode/IMG_20210804_163811.png" alt="微信支付" title="微信支付"></a><div><span style="color:#2DC100"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-wechat-pay-line"></use></svg></span></div></div></div></div><ul class="post-copyright"><li class="post-copyright-author"><strong>本文作者：</strong>Kken</li><li class="post-copyright-link"><strong>本文链接：</strong><a href="https://kenguo05.github.io/2021/08/05/blog-generating-sharing/" title="博客搭建过程与心得">https://kenguo05.github.io/2021/08/05/blog-generating-sharing/</a></li><li class="post-copyright-license"><strong>版权声明：</strong>本博客所有文章除特别声明外，均默认采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank" rel="noopener" title="CC BY-NC-SA 4.0 "><svg class="icon"><use xlink:href="#icon-creative-commons-line"></use></svg><svg class="icon"><use xlink:href="#icon-creative-commons-by-line"></use></svg><svg class="icon"><use xlink:href="#icon-creative-commons-nc-line"></use></svg><svg class="icon"><use xlink:href="#icon-creative-commons-sa-line"></use></svg></a> 许可协议。</li></ul></section></article><div class="post-nav"><div class="post-nav-item"><a class="post-nav-prev" href="/2021/08/18/SSL-makes-me-crazy-md/" rel="prev" title="被SSL搞疯了"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-left-s-line"></use></svg><span class="post-nav-text">被SSL搞疯了</span></a></div><div class="post-nav-item"><a class="post-nav-next" href="/2021/07/28/My-first-blog/" rel="next" title="My first blog"><span class="post-nav-text">My first blog</span><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-right-s-line"></use></svg></a></div></div></div><div class="hty-card" id="comment"><div class="comment-tooltip text-center"><span>欢迎文明交流讨论，拒绝ttk</span><br></div><div id="waline"></div><script>Yun.utils.getScript("https://cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js", () => {
  const walineConfig = {"enable":true,"serverURL":"https://blog-api-8nz1c1czc-kenguo05.vercel.app/","comment":false,"placeholder":"随便说说，别把域名整没就行~~","el":"#waline","lang":"zh-CN"}
  walineConfig.path = "/2021/08/05/blog-generating-sharing/"
  new Waline(walineConfig)
}, window.Waline);</script></div></main><footer class="sidebar-translate" id="footer"><div class="beian"><a rel="noopener" href="https://beian.miit.gov.cn/" target="_blank">湘ICP备2021013028号</a></div><div class="copyright"><span>&copy; 2021 </span><span class="with-love" id="animate"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-cloud-line"></use></svg></span><span class="author"> Kken</span></div><div class="powered"><span>由 <a href="https://hexo.io" target="_blank" rel="noopener">Hexo</a> 驱动 v5.4.0</span><span class="footer-separator">|</span><span>主题 - <a rel="noopener" href="https://github.com/YunYouJun/hexo-theme-yun" target="_blank"><span>Yun</span></a> v1.6.1</span></div><div class="live_time"><span>此站点已破壳</span><span id="display_live_time"></span><span class="moe-text">_(:з」∠)_</span><script>function blog_live_time() {
  setTimeout(blog_live_time, 1000);
  const start = new Date('2021-07-29T00:00:00');
  const now = new Date();
  const timeDiff = (now.getTime() - start.getTime());
  const msPerMinute = 60 * 1000;
  const msPerHour = 60 * msPerMinute;
  const msPerDay = 24 * msPerHour;
  const passDay = Math.floor(timeDiff / msPerDay);
  const passHour = Math.floor((timeDiff % msPerDay) / 60 / 60 / 1000);
  const passMinute = Math.floor((timeDiff % msPerHour) / 60 / 1000);
  const passSecond = Math.floor((timeDiff % msPerMinute) / 1000);
  display_live_time.innerHTML = " " + passDay + " 天 " + passHour + " 小时 " + passMinute + " 分 " + passSecond + " 秒";
}
blog_live_time();
</script></div><div class="footer-support"><span>本网站由</span><a class="footer-support-logo" href="https://www.upyun.com/?utm_source=lianmeng&amp;utm_medium=referral" target="blank" title="又拍云"><img height="30" src="https://cdn.jsdelivr.net/gh/Kenguo05/blog-img@main/img/blog-emoji/upyun_logo5.png" alt="又拍云"></a><span>提供CDN加速</span></div></footer><a class="hty-icon-button" id="back-to-top" aria-label="back-to-top" href="#"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-up-s-line"></use></svg><svg class="progress-circle-container" viewBox="0 0 100 100"><circle class="progress-circle" id="progressCircle" cx="50" cy="50" r="48" fill="none" stroke="#0078E7" stroke-width="2" stroke-linecap="round"></circle></svg></a><a class="popup-trigger hty-icon-button icon-search" id="search" href="javascript:;" title="搜索"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search-line"></use></svg></span></a><script>window.addEventListener("DOMContentLoaded", () => {
  // Handle and trigger popup window
  document.querySelector(".popup-trigger").addEventListener("click", () => {
    document.querySelector(".popup").classList.add("show");
    setTimeout(() => {
      document.querySelector(".search-input").focus();
    }, 100);
  });

  // Monitor main search box
  const onPopupClose = () => {
    document.querySelector(".popup").classList.remove("show");
  };

  document.querySelector(".popup-btn-close").addEventListener("click", () => {
    onPopupClose();
  });

  window.addEventListener("keyup", event => {
    if (event.key === "Escape") {
      onPopupClose();
    }
  });
});
</script><script src="/js/search/local-search.js" defer></script><div class="popup search-popup"><div class="search-header"><span class="popup-btn-close close-icon hty-icon-button"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-close-line"></use></svg></span></div><div class="search-input-container"><input class="search-input" id="local-search-input" type="text" placeholder="搜索..." value=""></div><div id="local-search-result"></div></div></div></body></html>